package com.longxiao.vo;

import com.longxiao.entity.User;

import java.util.Date;

/**
 * Created by yusong on 2017/5/3.
 * 可以暴露给客户端的用户信息
 */
public class UserVo {
    //用户token
    private String token;
    //用户ID
    private String userId;
    //用户类型 用户类型（1：学生，2：老师）
    private Integer userType;
    //图像链接
    private String imgUrl;
    //昵称
    private String nickname;
    //手机号
    private String mobile;
    //邮箱
    private String email;
    //性别 用户性别（0：女性，1：男性）
    private Integer gender;
    //生日
    private Date birthday;
//    生日：GMT时间
    private String birthdayGmt;
    //时区
    private String timezone;
    //积分
    private Integer cpScore;
    //国家
    private String country;
    //省份、州
    private String province;
    //城市
    private String city;
    //职业
    private String occupation;
    //上次登录时间
    private Date lastLoginTime;
    //注册时间
    private Date registerTime;
//    注册时间GMT时间
    private String registerTimeGmt;
    // 是否需要补充资料 0不需要  1需要补充
    private Integer isSupplementaryData = 0;

    public UserVo() {
    }

    public UserVo(User user) {
        this.userId = user.getUserId();
        this.userType = user.getUserType();
        this.imgUrl = user.getImgUrl();
        this.nickname = user.getNickname();
        this.mobile = user.getMobile();
        this.email = user.getEmail();
        this.gender = user.getGender();
        this.birthday = user.getBirthday();
        this.birthdayGmt = user.getBirthday() == null ? null : user.getBirthday().toGMTString();
        this.timezone = user.getTimezone();
        this.cpScore = user.getCpScore();
        this.country = user.getCountry();
        this.province = user.getProvince();
        this.city = user.getCity();
        this.occupation = user.getOccupation();
        this.lastLoginTime = user.getLastLoginTime();
        this.registerTime = user.getCreatedTime();
        this.registerTimeGmt = user.getCreatedTime() == null ? null : user.getCreatedTime().toGMTString();
    }

    public UserVo(User user,String token) {
        this.userId = user.getUserId();
        this.userType = user.getUserType();
        this.imgUrl = user.getImgUrl();
        this.nickname = user.getNickname();
        this.mobile = user.getMobile();
        this.email = user.getEmail();
        this.gender = user.getGender();
        this.birthday = user.getBirthday();
        this.birthdayGmt = user.getBirthday() == null ? null : user.getBirthday().toGMTString();
        this.timezone = user.getTimezone();
        this.cpScore = user.getCpScore();
        this.country = user.getCountry();
        this.province = user.getProvince();
        this.city = user.getCity();
        this.occupation = user.getOccupation();
        this.lastLoginTime = user.getLastLoginTime();
        this.registerTime = user.getCreatedTime();
        this.registerTimeGmt = user.getCreatedTime() == null ? null : user.getCreatedTime().toGMTString();
        this.token = token;
    }

    @Override
    public String toString() {
        return "UserVo{" +
                "token='" + token + '\'' +
                ", userId='" + userId + '\'' +
                ", userType=" + userType +
                ", imgUrl='" + imgUrl + '\'' +
                ", nickname='" + nickname + '\'' +
                ", mobile='" + mobile + '\'' +
                ", email='" + email + '\'' +
                ", gender=" + gender +
                ", birthday=" + birthday +
                ", birthdayGmt='" + birthdayGmt + '\'' +
                ", timezone='" + timezone + '\'' +
                ", cpScore=" + cpScore +
                ", country='" + country + '\'' +
                ", province='" + province + '\'' +
                ", city='" + city + '\'' +
                ", occupation='" + occupation + '\'' +
                ", lastLoginTime=" + lastLoginTime +
                ", registerTime=" + registerTime +
                ", registerTimeGmt='" + registerTimeGmt + '\'' +
                ", isSupplementaryData=" + isSupplementaryData +
                '}';
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getBirthdayGmt() {
		return birthdayGmt;
	}

	public void setBirthdayGmt(String birthdayGmt) {
		this.birthdayGmt = birthdayGmt;
	}

	public String getTimezone() {
        return timezone;
    }

    public void setTimezone(String timezone) {
        this.timezone = timezone;
    }

    public Integer getCpScore() {
        return cpScore;
    }

    public void setCpScore(Integer cpScore) {
        this.cpScore = cpScore;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getOccupation() {
        return occupation;
    }

    public void setOccupation(String occupation) {
        this.occupation = occupation;
    }

    public Date getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Date lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public Date getRegisterTime() {
        return registerTime;
    }

    public void setRegisterTime(Date registerTime) {
        this.registerTime = registerTime;
    }

	public String getRegisterTimeGmt() {
		return registerTimeGmt;
	}

	public void setRegisterTimeGmt(String registerTimeGmt) {
		this.registerTimeGmt = registerTimeGmt;
	}

    public Integer getIsSupplementaryData() {
        return isSupplementaryData;
    }

    public void setIsSupplementaryData(Integer isSupplementaryData) {
        this.isSupplementaryData = isSupplementaryData;
    }
}
